import { post } from '@/core/utils/http';
import type { Response, AdvertPositionType, PinTuanListType } from '@/core/models';

/**  获取商品分类配置 */
export const queryPositionList = (data : { code : string, platform : number }) : Promise<Response<AdvertPositionType>> => {
	return post('Api/Advert/GetPositionList', {
		data,
	});
}

/** 获取拼团列表 */
export const queryPinTuanList = (data : any) : Promise<Response<Array<PinTuanListType>>> => {
	return post('Api/PinTuan/GetList', {
		data,
	});
}

/** 获取拼团商品详情 */
export const queryPinTuanGoodsDetail = (data : any) : Promise<Response<any>> => {
	return post('Api/PinTuan/GetGoodsInfo', {
		data,
	});
}

/** 获取服务详情 */
export const queryServiceDetail = (data : any) : Promise<Response<any>> => {
	return post('Api/Service/GetDetails', {
		data,
	});
}

/** 获取活动详情 */
export const queryActivityList = (data : any) : Promise<Response<any>> => {
	return post('Api/Group/GetList', {
		data,
	});
}

/** 获取秒杀团购详情 */
export const queryActivityDetial = (data : any) : Promise<Response<any>> => {
	return post('Api/Group/GetGoodsDetial', {
		data,
	});
}

/** 获取接龙列表 */
export const querySolitaireList = (data : any) : Promise<Response<any>> => {
	return post('Api/Solitaire/GetList', {
		data,
	});
}

/** 获取接龙详情 */
export const querySolitaireDetail = (data : any) : Promise<Response<any>> => {
	return post('Api/Solitaire/GetDetail', {
		data,
	});
}

/** 获取表单列表 */
export const queryFormList = (data : any) : Promise<Response<any>> => {
	return post('Api/Form/GetList', {
		data,
	});
}

/** 获取表单详情 */
export const queryFormDetial = (data : any) : Promise<Response<any>> => {
	return post('Api/Form/GetFormDetial', {
		data,
	});
}

/** 提交表单 */
export const queryAddSubmit = (data : any) : Promise<Response<any>> => {
	return post('Api/Form/AddSubmit', {
		data,
	});
}

/** 生成服务购买订单 */
export const queryAddServiceOrder = (data : any) : Promise<Response<any>> => {
	return post('Api/Service/AddServiceOrder', {
		data,
	}, true);
}